home *** CD-ROM | disk | FTP | other *** search
- From: "Rene G.A. Ros" <rgaros@bio.vu.nl>
- Subject: 4D ISBN Check procedure
- Date: Thu, 14 Jul 1994 09:08:01 +0200 (MET DST)
-
-
- ISBN check proc.txt
-
- Small procedure for 4D to check if ISBN book number is correctly
- entered.
-
- Rene Ros
- rgaros@bio.vu.nl
-
- Archived as: /info-mac/dev/a4d/isbn-check.txt
-
-
- `this procedure determines if the entered ISBN number is valid by
- `checking the checksum of the number
- `By doing this you can check if there were no type mismatches.
-
- `Ported to 4D by Rene G.A. Ros
- `D.C. van Krimpenstraat 3
- `1067 SG Amsterdam
- `The Netherlands, Europe
- `rgaros@bio.vu.nl
-
- `result:=ISBN(book nr)
- `result is a boolean which is TRUE when the book nr is correct, and FALSE if not.
- `book nr is the full ISBN number without dashes and/or spaces
-
- `place somewhere else:
- `C_STRING("ISBN check";10;$1)
- `C_BOOLEAN("ISBN check";$0)
-
- C_INTEGER($sum;$i)
-
- $sum:=0
- For ($i;10;1;-1)
- If ($1Length($1)-$i+1="X"
- $sum:=$sum+($i*10)
- Else
- $sum:=$sum+($i*Num($1Length($1)-$i+1)
- End if
- End for
- $0:=($sum%11=0)
-
-